package edu.unf.cen6940.converter;

import java.text.ParseException;
import java.util.Locale;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.format.Formatter;
import org.springframework.stereotype.Component;

import edu.unf.cen6940.dao.ThesiscommitteeDAO;
import edu.unf.cen6940.domain.Thesiscommittee;

@Component
public class ThesiscommitteeConverter implements Formatter<Thesiscommittee>{
	@Autowired
	ThesiscommitteeDAO thesiscommitteeDAO;
	
	@Override
	public String print(Thesiscommittee object, Locale locale) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public Thesiscommittee parse(String text, Locale locale) throws ParseException {
		System.out.println("Committed id: "+text);
		return thesiscommitteeDAO.findThesiscommitteeByThesisCommitteeId(Integer.parseInt(text));
	}
}